<?php defined('BASEPATH') OR exit('No direct script access allowed');



// This can be removed if you use __autoload() in config.php OR use Modular Extensions
require APPPATH.'/libraries/REST_Controller.php';

class Users extends REST_Controller
{
	function index_get()
	{
	    $data = array('username'=>'phuong');
	    $this->session->set_userdata($data);
	    $session = $this->session->userdata(''); 
	    $this->response($session, 200);
	}
	function add_post(){
	    $array = $this->get_post_array($_POST);
	    $data['table'] = 'user';
	    $data['array'] = $array; 
	    $this->load->model('Users_model');
	    $res = $this->Users_model->add_user($data);
	    $this->response($res, 200);
	}
	
}